﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BookReader
{
    class wmCommand:ICommand
    {
        #region ICommand 成员

        void ICommand.Execute(string[] param)
        {
            Config.BookMarkerRow row = StaticData.config.BookMarker.FindByFileName(StaticData.openFilepath);
            if (row == null)
            {
                row = StaticData.config.BookMarker.NewBookMarkerRow();
                row.FileName = StaticData.openFilepath;
                row.PageIndex = StaticData.PageIndex;
                StaticData.config.BookMarker.AddBookMarkerRow(row);
            }
            else
            {
                row.PageIndex = StaticData.PageIndex;
            }
            Console.WriteLine("书签设定在" + StaticData.PageIndex + "页");
        }

        string ICommand.Help()
        {
            return "wm命令：设定书签";
        }

        #endregion
    }
}
